using System;
using System.Data;
using System.Collections;
using APP.QUANLY.Common;

namespace RMAS.DAL
{
    /// <summary>
    /// Summary description for DM_USER.
    /// </summary>
    public class DM_USER
    {
        private string _UserName;
        private string _FullName;
        private string _Pass;
        private DateTime _Create;
        private Int16 _Status;
        private string _Group;
        private string _Address;
        private string _Phone;
        private string _Mobile;
        private string _Email;
        private Int32 _AutoItem;
        private short _lockActive;
        private Int32 _AgentID;
        private string _IDPOS;
        private DM_SHIFTSList _listDM_SHIFTS;
        private DM_GROUP _DM_GROUP; 
        private bool isExisting;
        #region Properties
        public bool IsExisting
        {
            get { return isExisting; }
            set { isExisting = value; }
        }
        public bool IsSetUserName;
        public bool IsUserNameNullable
        {
            get { return false; }
        }
        public string UserName
        {
            get { return _UserName; }
            set
            {
                _UserName = value;
                IsSetUserName = true;
            }
        }
        public bool IsSetFullName;
        public bool IsFullNameNullable
        {
            get { return false; }
        }
        public string FullName
        {
            get { return _FullName; }
            set
            {
                _FullName = value;
                IsSetFullName = true;
            }
        }
        public bool IsSetPass;
        public bool IsPassNullable
        {
            get { return false; }
        }
        public string Pass
        {
            get { return _Pass; }
            set
            {
                _Pass = value;
                IsSetPass = true;
            }
        }
        public bool IsSetCreate;
        public bool IsCreateNullable
        {
            get { return false; }
        }
        public DateTime Create
        {
            get { return _Create; }
            set
            {
                _Create = value;
                IsSetCreate = true;
            }
        }
        public bool IsSetStatus;
        public bool IsStatusNullable
        {
            get { return false; }
        }
        public Int16 Status
        {
            get { return _Status; }
            set
            {
                _Status = value;
                IsSetStatus = true;
            }
        }
        public bool IsSetGroup;
        public bool IsGroupNullable
        {
            get { return false; }
        }
        public string Group
        {
            get { return _Group; }
            set
            {
                _Group = value;
                IsSetGroup = true;
            }
        }
        public bool IsSetAddress;
        public bool IsAddressNullable
        {
            get { return false; }
        }
        public string Address
        {
            get { return _Address; }
            set
            {
                _Address = value;
                IsSetAddress = true;
            }
        }
        public bool IsSetPhone;
        public bool IsPhoneNullable
        {
            get { return false; }
        }
        public string Phone
        {
            get { return _Phone; }
            set
            {
                _Phone = value;
                IsSetPhone = true;
            }
        }
        public bool IsSetMobile;
        public bool IsMobileNullable
        {
            get { return false; }
        }
        public string Mobile
        {
            get { return _Mobile; }
            set
            {
                _Mobile = value;
                IsSetMobile = true;
            }
        }
        public bool IsSetEmail;
        public bool IsEmailNullable
        {
            get { return false; }
        }
        public string Email
        {
            get { return _Email; }
            set
            {
                _Email = value;
                IsSetEmail = true;
            }
        }
        public bool IsSetAutoItem;
        public bool IsAutoItemNullable
        {
            get { return false; }
        }
        public Int32 AutoItem
        {
            get { return _AutoItem; }
            set
            {
                _AutoItem = value;
                IsSetAutoItem = true;
            }
        }
        public bool IsSetLockActive;
        public bool IsLockActiveNullable
        {
            get { return false; }
        }
        public Int16 lockActive
        {
            get { return _lockActive; }
            set
            {
                _lockActive = value;
                IsSetLockActive = true;
            }
        }
        public bool IsSetAgentID;
        public bool IsAgentIDNullable
        {
            get { return false; }
        }
        public Int32 AgentID
        {
            get { return _AgentID; }
            set
            {
                _AgentID = value;
                IsSetAgentID = true;
            }
        }
        public bool IsSetIDPOS;
        public bool IsIDPOSNullable
        {
            get { return false; }
        }
        public string IDPOS
        {
            get { return _IDPOS; }
            set
            {
                _IDPOS = value;
                IsSetIDPOS = true;
            }
        }
        public DM_SHIFTSList DM_SHIFTSList
        {
            get { return _listDM_SHIFTS; }
            set { _listDM_SHIFTS = value; }
        }
        public DM_GROUP DM_GROUP
        {
            get { return _DM_GROUP; }
            set { _DM_GROUP = value; }
        }
        #endregion

        #region Constructors
        public DM_USER()
        {
            Reset();
        }
        public DM_USER(DM_USER obj)
        {
            this._UserName = obj.UserName;
            this._FullName = obj.FullName;
            this._Pass = obj.Pass;
            this._Create = obj.Create;
            this._Status = obj.Status;
            this._Group = obj.Group;
            this._Address = obj.Address;
            this._Phone = obj.Phone;
            this._Mobile = obj.Mobile;
            this._Email = obj.Email;
            this._AutoItem = obj.AutoItem;
            this._lockActive = obj.lockActive;
            this._AgentID = obj.AgentID;
            this._IDPOS = obj.IDPOS;
        }
        #endregion

        public void Reset()
        {
            _UserName = EmptyValues.v_string;
            _FullName = EmptyValues.v_string;
            _Pass = EmptyValues.v_string;
            _Create = EmptyValues.v_DateTime;
            _Status = EmptyValues.v_Int16;
            _Group = EmptyValues.v_string;
            _Address = EmptyValues.v_string;
            _Phone = EmptyValues.v_string;
            _Mobile = EmptyValues.v_string;
            _Email = EmptyValues.v_string;
            _AutoItem = EmptyValues.v_Int32;
            _lockActive = EmptyValues.v_Int16;
            _AgentID = EmptyValues.v_Int32;
            _IDPOS = EmptyValues.v_string;
            _listDM_SHIFTS = null;
            _DM_GROUP = null;
        }


        #region Hidden

        /*
        private void readProperties(IDataReader reader)
        {
            try
            {
                                if(!(reader["UserName"] is DBNull))
		{
			obj.UserName = (string)reader["UserName"];
		}
                if(!(reader["FullName"] is DBNull))
		{
			obj.FullName = (string)reader["FullName"];
		}
                if(!(reader["Pass"] is DBNull))
		{
			obj.Pass = (string)reader["Pass"];
		}
                if(!(reader["Create"] is DBNull))
		{
			obj.Create = (DateTime)reader["Create"];
		}
                if(!(reader["Status"] is DBNull))
		{
			obj.Status = (Int16)reader["Status"];
		}
                if(!(reader["Group"] is DBNull))
		{
			obj.Group = (string)reader["Group"];
		}
                if(!(reader["Address"] is DBNull))
		{
			obj.Address = (string)reader["Address"];
		}
                if(!(reader["Phone"] is DBNull))
		{
			obj.Phone = (string)reader["Phone"];
		}
                if(!(reader["Mobile"] is DBNull))
		{
			obj.Mobile = (string)reader["Mobile"];
		}
                if(!(reader["Email"] is DBNull))
		{
			obj.Email = (string)reader["Email"];
		}
                if(!(reader["AutoItem"] is DBNull))
		{
			obj.AutoItem = (Int32)reader["AutoItem"];
		}
                if(!(reader["lockActive"] is DBNull))
		{
			obj.LockActive = (Int16)reader["lockActive"];
		}
                if(!(reader["AgentID"] is DBNull))
		{
			obj.AgentID = (Int32)reader["AgentID"];
		}
                if(!(reader["IDPOS"] is DBNull))
		{
			obj.IDPOS = (string)reader["IDPOS"];
		}
//            _UserName = (reader["UserName"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["UserName"];
//            _FullName = (reader["FullName"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["FullName"];
//            _Pass = (reader["Pass"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Pass"];
//            _Create = (reader["Create"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["Create"];
//            _Status = (reader["Status"] is DBNull)?DalTools.EmptyValues.v_Int16:(Int16)reader["Status"];
//            _Group = (reader["Group"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Group"];
//            _Address = (reader["Address"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Address"];
//            _Phone = (reader["Phone"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Phone"];
//            _Mobile = (reader["Mobile"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Mobile"];
//            _Email = (reader["Email"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Email"];
//            _AutoItem = (reader["AutoItem"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["AutoItem"];
//            _lockActive = (reader["lockActive"] is DBNull)?DalTools.EmptyValues.v_Int16:(Int16)reader["lockActive"];
//            _AgentID = (reader["AgentID"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["AgentID"];
//            _IDPOS = (reader["IDPOS"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["IDPOS"];
            }
            catch (Exception ex)
            {
                throw new DalException("Failed to read properties from DataReader.", ex);
            }
        } 
        */

        #endregion


        public void Fill(string UserName, string FullName, string Pass, DateTime Create, Int16 Status, string Group, string Address, string Phone, string Mobile, string Email, Int32 AutoItem, Int16 lockActive, Int32 AgentID, string IDPOS)
        {
            this._UserName = UserName;
            this._FullName = FullName;
            this._Pass = Pass;
            this._Create = Create;
            this._Status = Status;
            this._Group = Group;
            this._Address = Address;
            this._Phone = Phone;
            this._Mobile = Mobile;
            this._Email = Email;
            this._AutoItem = AutoItem;
            this._lockActive = lockActive;
            this._AgentID = AgentID;
            this._IDPOS = IDPOS;
        }
    }
}